---
sidebar_position: 10
---

# Math

Most typical JavaScript Math function are supported. Please file an issue if we missed one.

## Math.map

Maps a value between two ranges.

```ts
const ratio = 0.5 // [0, 1]
const percent = Math.map(ratio, 0, 1, 0, 100)
```

## Math.constrain

Constrains a value between two values.

```ts
const v = -0.1 // [0, 1]
const c = Math.constrain(v, 0, 1)
```
